import { onMounted, onUnmounted } from "vue"
import { throttle } from "@/utils/throttle";

export const useEchart = (callback) => {
    onMounted(() => {
        window.addEventListener('resize', throttle(callback, 500))
    })

    onUnmounted(() => {
        window.removeEventListener('resize', throttle(callback, 500))
    })
}